package com.spring.demo2;

/**
 * @author:liuwei
 * @creatdate:2021-07-13-11:23
 */
public class UserServiceproxy implements UserService{

	private UserServiceImpl userServiceImpl;

	public void setUserServiceImpl(UserServiceImpl userServiceImpl) {
		this.userServiceImpl = userServiceImpl;
	}

	@Override
	public void add() {
		log("add");
		userServiceImpl.add();
	}

	@Override
	public void delete() {
		log("delete");
		userServiceImpl.delete();
	}

	@Override
	public void update() {
		log("update");
		userServiceImpl.update();
	}

	@Override
	public void query() {
		log("query");
		userServiceImpl.query();
	}

	//日志方法
	public void log(String msg){
		System.out.println("使用了"+ msg +"方法");
	}
}
